package com.atguigu.order.controller;


import com.atguigu.gmall.common.bean.ResponseVo;
import com.atguigu.gmall.oms.vo.OrderSubmitVo;
import com.atguigu.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;

@Controller
@RequestMapping
public class OrderController {

    @Autowired
    private OrderService orderService;

    @GetMapping("/confirm")
    public String confirm() {
        //使用userId,使用拦截器传递userId给后续的业务使用
        HashMap<Object, Object> map = new HashMap<>();
        return "";
    }


    @PostMapping("/submit")
    public ResponseVo<Object> submit(@RequestBody OrderSubmitVo orderSubmitVo) {
        orderService.createOrder(orderSubmitVo);
        return ResponseVo.ok();
    }

}
